﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.CopsBanditsUI {
    import flash.events.*;
    import Engine.Managers.*;
    import flash.display.*;
    import flash.utils.*;
    import Display.DialogUI.*;
    import Classes.util.*;
    import Modules.bandits.*;

    public class BanditEscapedDialog extends GenericDialog {

        protected var m_bandit:BanditData;
        protected var m_iconLoader:Loader;
        protected var m_numAssetLoads:int = 2;
        protected var m_imagesLoaded:int = 0;
        protected var m_moreCops:Boolean;

        public function BanditEscapedDialog(_arg1:int, _arg2:Boolean=false, _arg3:Function=null, _arg4:Boolean=true, _arg5:Function=null){
            var _local6:Object = {id:_arg1};
            this.m_bandit = new BanditData(_local6);
            this.m_moreCops = _arg2;
            var _local7 = "BanditEscaped";
            var _local8 = "";
            if (_arg2){
                _local8 = ZLoc.t("Dialogs", "BanditEscaped_moreCops_message");
            } else {
                _local8 = ZLoc.t("Dialogs", "BanditEscaped_moreDonuts_message");
            };
            super(_local8, _local7, GenericDialogView.TYPE_OK, _arg3, _local7, "", _arg4, 0, "", _arg5);
        }
        override protected function loadAssets():void{
            Global.delayedAssets.get(DelayedAssetLoader.GENERIC_DIALOG_ASSETS, makeAssets);
            if (this.m_bandit.portraitUrl){
                this.m_iconLoader = LoadingManager.load(Global.getAssetURL(this.m_bandit.portraitUrl), this.onAssetsLoaded, LoadingManager.PRIORITY_HIGH);
            };
        }
        override protected function onAssetsLoaded(_arg1:Event=null):void{
            this.m_imagesLoaded++;
            if (this.m_imagesLoaded < this.m_numAssetLoads){
                return;
            };
            super.onAssetsLoaded(_arg1);
        }
        override protected function createAssetDict():Dictionary{
            var _local1:Dictionary;
            _local1 = new Dictionary();
            _local1["dialog_bg"] = (new m_comObject.dialog_bg() as DisplayObject);
            m_assetBG = _local1["dialog_bg"];
            _local1["banditIcon"] = this.m_iconLoader.content;
            return (_local1);
        }
        override protected function createDialogView(_arg1:Dictionary):GenericDialogView{
            var _local2:GenericDialogView = new BanditEscapedDialogView(_arg1, this.m_bandit, this.m_moreCops, m_message, m_dialogTitle, m_callback, m_SkipCallback);
            return (_local2);
        }

    }
}//package Display.CopsBanditsUI 
